package com.dwms.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author WH
 * @className: SwaggerConfig
 * @description: Swagger配置
 * @create 2025/08/11
 **/

@Configuration
public class SwaggerConfig {

    private final static String TITLE = "唛橙D-WMS管理系统WEB API";


    /**
     * SpringDoc 标题、描述、版本等信息配置
     *
     * @return openApi 配置信息
     */
    @Bean
    public OpenAPI springDocOpenAPI() {
        return new OpenAPI().info(new Info().title(TITLE).description(TITLE + "文档说明"));
    }

    /**
     * 公共分组
     */
    @Bean
    public GroupedOpenApi commonApi() {
        return GroupedOpenApi.builder().group("common").displayName("公共接口")
                .packagesToScan("com.dwms.controller")
                .pathsToMatch("/**")
                .build();
    }
}
